package com.shycloud.mido.member.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shycloud.mido.member.api.entity.MemberPrice;
import com.shycloud.mido.member.mapper.MemberPriceMapper;
import com.shycloud.mido.member.service.MemberPriceService;

import lombok.AllArgsConstructor;

/**
 * 会员价格实现
 *  @author yyy
 *  @date 2019/05/20
 */
@Service
@AllArgsConstructor
public class MemberPriceServiceImpl extends ServiceImpl<MemberPriceMapper, MemberPrice> implements MemberPriceService {
	private MemberPriceMapper memberPriceMapper;

	/**
	 * 保存会员价格
	 * @param memberPrice 会员价格实体
	 */
	@Override
	public void savePrice(MemberPrice memberPrice){
		if(null!=memberPrice.getId()){
			memberPriceMapper.updPrice(memberPrice);
		}else{
			memberPriceMapper.savePrice(memberPrice);
		}
	}

	/**
	 * 查询会员价格列表
	 * @param type 会员类型
	 * @return
	 */
	@Override
	public List<MemberPrice> selMemberPrice(String type){
		return memberPriceMapper.selMemberPrice(type);
	}
}
